import { createRouter, createWebHistory } from 'vue-router'
import Login from '../views/Login.vue'
import Start from '@/views/start.vue'
import Main from '@/views/Main.vue'
import Register from '@/views/Register.vue'
import SingleChat from '@/views/SingleChat.vue'
import GroupChat from '@/views/GroupChat.vue';  // 群聊页面

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'start',
      component: Start,
    },
    {
      path: '/login',
      name: 'login',
      component: Login,
    },
    {
      path: '/main',
      name: 'main',
      component: Main,
    },
    {
      path: '/register',
      name: 'register',
      component: Register,
    },
    {
      path: '/singleChat/:friendName',
      name:'singleChat',
      component: SingleChat,
    }, 
    {
      path: '/groupChat/:groupId',
      name: 'groupChat',
      component: GroupChat
    }

  ],
})

export default router
